package cz.tomasdvorak.cars.dao;

import cz.tomasdvorak.cars.dto.Expense;
import cz.tomasdvorak.cars.dto.ExpenseCriteria;

import java.util.List;

public interface ExpensesDao {
    /**
     * Creates or updates existing expense. if id equals -1, then creates new,
     * updates otherwise
     * @param expense expense to update or create
     */
    void insertOrUpdate(Expense expense);

    /**
     * Get all expenses filtered by criteria
     * @param criteria criteria used to filter expense results
     * @return List of all expenses specified by {@code criteria}
     */
    List<Expense> getAll(ExpenseCriteria criteria);
}
